let env = require('./env');
const { redis } = require('./env');
const RedisStore = require('koa-redis')(redis);
let session = {
  key: 'ssession',
  rolling: true,
  store: RedisStore,      //redis储存session
  cookie: {
    path: '/',
    httpOnly: true,
    maxAge: 24 * 60 * 60 * 1000,  //cookie 有效期1天，默认为 session 的 ttl
    overwrite: true,
    signed: true
  }
};

module.exports = session;